#ifndef _DOUBLELINKLIST_H_
#define _DOUBLELINKLIST_H_
#define ElementType void*
struct Node
{
    ElementType data;
    struct Node*next;
    struct Node*prev;
};

struct DoubleLinkList
{
    struct Node *head;
    struct Node *tail;
    int len;
};
typedef struct DoubleLinkList DLlist;

int InitDLlist(DLlist *list);
void InsertTail(DLlist *list,ElementType element);
void InsertHead(DLlist *list,ElementType element);
void RemoveByIndex(DLlist *list,int index);
void RemoveByelement(DLlist *list,ElementType element);
int FindFirstByElement(DLlist *list,ElementType element);

int GetListLen(DLlist*list);
void Travel1(DLlist *list,void(*func)(ElementType));
void FreeDLlist(DLlist *list);
#endif